﻿using HuaHan.WorkTicket.Domain.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaHan.WorkTicket.Domain.Repositories.EntityFramework.ModelConfigurations
{
    public class UserConfiguration : BaseConfiguration<User>
    {
        public UserConfiguration()
            : base()
        {
            this.ToTable("tblUser");
            this.Property(c => c.EID)
                .IsRequired()
                .HasMaxLength(20);
            this.Property(c => c.Name)
                .IsRequired()
                .HasMaxLength(20);
            this.Property(c => c.UserName)
                .HasMaxLength(50);
            this.Property(c => c.Password)
                .HasMaxLength(50);
            this.Property(c => c.Mobile)
                .HasMaxLength(50);
            this.Property(c => c.Sex)
                .HasMaxLength(10);
            this.Property(c => c.Birthday);
            this.Property(c => c.Age);

            this.Property(c => c.Email)
                .HasMaxLength(50);
            this.Property(c => c.Photo)
                .HasMaxLength(20);

            this.Property(c => c.HomeAddress)
                .HasMaxLength(200);

        }
    }
}
